package com.yl.framework.interceptor;


import com.yl.common.core.domain.entity.SysUser;
import org.springframework.stereotype.Component;

@Component
public  class UserContext {

    private  static  ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    public static void setUser(SysUser user) {
       threadLocal.set(user);
    }

    public static SysUser getUser() {
        return threadLocal.get();
    }

    public static void removeUser(){
        threadLocal.remove();
    }
}
